﻿var Bootstrapper = {};

Bootstrapper.configureValidation = function() {
    jQuery.validator.setDefaults({
        errorClass: "input-validation-error",
        errorElement: "span",
        errorLabelContainer: ".validation-summary-errors ul",
        wrapper: "li",
        invalidHandler: function(form, validator) {
            $(".validation-summary-errors").show();
        },
        unhighlight: function(element, errorClass) {
            if (this.numberOfInvalids() == 0) {
                $(".validation-summary-errors").hide();
            }

            $(element).removeClass(errorClass);
        }
    });
}

$(document).ready(function() {
    Bootstrapper.configureValidation();
});